<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>政务数据资产普查系统</title>
<link rel="stylesheet" href="../../public/libs/layui/css/layui.css">
<link rel="stylesheet" href="../../public/css/main.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_540221_mtvfb4bu66y4aemi.css">
</head>

<body>
    <div class="editPd_content" id="layerwrap">

        <div id="edit_layer">
            <form id="edit_form" class="layui-form" action="">
                <div class="layui-form-item">
                    <input type="hidden" name="id" v-model="formList.id">
                    <label class="layui-form-label">上级机构</label>
                    <div class="layui-input-block">
                        <input type="text" name="password" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input" v-model="formList.password">
                    </div>
                </div>
                <div class="layui-form-item">
                    <input type="hidden" name="id" v-model="formList.id">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="oldPassword" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input" v-model="formList.oldPassword">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">机构编码</label>
                    <div class="layui-input-block">
                        <input type="text" name="newPassword" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input" v-model="formList.newPassword">
                    </div>
                </div>
                <button v-show="buttonDisp" class="layui-btn layui-submit" lay-submit="" lay-filter="form_submit">立即提交</button>
            </form>
        </div>

    </div>
</body>
<script src="../../public/libs/jquery-2.1.1.min.js"></script>
<script src="../../public/libs/layui/layui.js"></script>
<script src="../../public/libs/vue.js"></script>
<script src="../../components/deptTree.js"></script>
<script type="text/javascript">

    var vm = new Vue({
        el:'.editPd_content',
        data: {
            formList: {
                password: '',
                oldPassword: '',
                newPassword: ''
            }
        },
        methods: {
            refreshData () {
                for (var i in vm.formList) {
                    vm.formList[i] = ''
                }
            },
            validate () {
                layui.use(['form', 'layedit', 'laydate'], function(){
                    var form = layui.form
                    ,layer = layui.layer
                    ,layedit = layui.layedit
                    ,laydate = layui.laydate;

                    form.on('submit(form_submit)', function(data){
                        $.ajax({
                            url: '/user/updatePassword',
                            data: data.field,
                            type: 'post',
                            success: function (res) {
                                vm.refreshData();
                                layer.close(layeForm)
                            }
                        })
                        return false;
                    });
                })
            }
        },
        created () {
    })

</script>

</html>